import { BannerRep } from "@/api/home";
import { server } from "@/utils/server";
import HomeSwiper from "../_home/HomeSwiper";
const getBanners = async () => {
    return server
        .request<BannerRep[]>({
            url: "/v1/api/front/banner_list",
            method: "POST",
            body: JSON.stringify({}),
            next: { revalidate: 0 },
        })
        .then((res) => {
            if (res.code === 200) return res.data;
            return [];
        });
};
const Page = async () => {
    const banners = await getBanners();
    if (!banners.length) return null;
    return <HomeSwiper banners={banners}></HomeSwiper>;
};

export default Page;
